package utils;

import model.User;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * 功能描述
 *
 * @author wileda
 * @date 2023/04/10  17:54
 */
public class UserUtil {
    public static User checkUserLoginStatus(HttpServletRequest req){
        if(req == null){
            return null;
        }
        HttpSession session = req.getSession();
        if(session == null){
            return null;
        }
        User user = (User)session.getAttribute("userInfo");
        return user;
    }
}
